﻿'Description:批次检验类接口
'Copyright (c) : 通力凯顿（北京）系统集成有限公司
'Writer:Yangsj
'create Date:2017-5-8
'Rewriter:
'Rewrite Date:
Imports BusinessRule.DTO
Imports System.Data.OracleClient
Public Interface uLMSCheckIBusiness
    ''' <summary>
    ''' 获取首件批次号
    ''' </summary>
    ''' <param name="contaienrId"></param>
    ''' <param name="stepId"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetFirstCheckContainerNo(ByVal contaienrId As String, ByVal stepId As String) As String
    ''' <summary>
    ''' 获取待检验批次
    ''' Create：YangSJ
    ''' </summary>
    ''' <param name="QueryCondition"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainerCheckData(ByVal QueryCondition As System.Collections.Generic.Dictionary(Of String, String)) As uMESProcessResult

    ''' <summary>
    ''' 查询单件单卡子卡的所需信息
    ''' add:Wangjh 20180817
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetChildContainerNo(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' 获取首件检验单号
    ''' </summary>
    ''' <param name="strFanctoryCode"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetFirstCheckBillNo(ByVal strFanctoryCode As String) As String

    ''' <summary>
    ''' 按唯一id删除批次检验记录
    ''' create tianFW
    ''' </summary>
    ''' <param name="containercheckinfoid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function DelContainerCheckInfo(ByVal containercheckinfoid As String) As Boolean

    ''' <summary>
    ''' 添加批次成品检验记录
    ''' create tianFW
    ''' </summary>
    ''' <param name="entity"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function AddContainerFinishedCheckInfo(ByVal entity As ContainerFinishedCheckInfoDTO) As Boolean

    ''' <summary>
    ''' 添加批次检验记录
    ''' create tianFW
    ''' </summary>
    ''' <param name="entity"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function AddContainerCheckInfo(ByVal entity As ContainerCheckInfoDTO) As Boolean

    ''' <summary>
    ''' 按唯一ID删除批次成品检验记录明细
    ''' create tianFW
    ''' </summary>
    ''' <param name="ContainerFinishedCheckInfoID"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function DelContainerFinishedCheckDetailByccid(ByVal ContainerFinishedCheckInfoID As String) As Boolean

    ''' <summary>
    ''' 添加批次成品检验记录明细
    ''' </summary>
    ''' <param name="entity"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function AddContainerFinishedCheckDetailInfo(ByVal entity As ContainerFinishedCheckDetailDTO) As Boolean

    ''' <summary>
    ''' 按唯一ID删除批次成品检验记录
    ''' create tianFW
    ''' </summary>
    ''' <param name="ContainerFinishedCheckInfoID"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function DelContainerFinishedCheckInfoBycfciid(ByVal ContainerFinishedCheckInfoID As String) As Boolean

    ''' <summary>
    ''' 工序是否工艺最后序
    ''' </summary>
    ''' <param name="strStepID"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function IsLastStepFinished(ByVal strStepID As String) As Boolean

    ''' <summary>
    ''' 查询批次工艺的父工序是否是最后一道序
    ''' create:Wangjh 20171219
    ''' </summary>
    ''' <param name="strStepID"></param>
    ''' <param name="containerID"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function IsLastFinishedOfFaWorkflow(ByVal strStepID As String, ByVal containerID As String) As DataTable

    ''' <summary>
    ''' 获取试验件报工
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetTestReport(ByVal para As Dictionary(Of String, String))

    ''' <summary>
    ''' 获取批次的所有检验的合格数
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetAllAcceptQty(ByVal containerID As String) As DataTable

    ''' <summary>
    ''' 获取批次的所有检验的合格数
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetAllFinishAcceptQty(ByVal containerID As String) As DataTable

    ''' <summary>
    ''' 判断指定工序是否是该批次转工的最后一道工序
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function IsLastShipStep(ByVal para As Dictionary(Of String, String)) As Boolean

    ''' <summary>
    ''' 获取批次当前工序的不合格审理信息
    ''' creat:Wangjh 2017-6-19
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainerNonconformingInfo(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' 更新报工表的报废数或成品检验ID
    ''' create:Wangjh 
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateContainerStepWorkReport(ByVal para As Dictionary(Of String, Object)) As Boolean

    ''' <summary>
    ''' 获取有成品检验的批次 create tianFW 2017.07.19
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainer_CheckInfo(ByVal para As Dictionary(Of String, String)) As uMESProcessResult

    ''' <summary>
    ''' 获取成品检验信息 create tianFW 2017.07.19
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainerFinishCheckInfo(ByVal ContainerID As String, ByVal WorkflowStepID As String) As DataTable

    ''' <summary>
    ''' 根据成品检验ID获取成检详细信息 create tianFW 2017/07/21
    ''' </summary>
    ''' <param name="containerFinishedCheckInfoIDs"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetFinishCheckInfoDetail(ByVal containerFinishedCheckInfoIDs As String) As DataTable

    ''' <summary>
    ''' 获取所有的检验记录 create tianFW 2017/08/17
    ''' </summary>
    ''' <param name="para">containerid,workflowstepid,currentstatus</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetHistoryCheckInfo(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' 获取所有的成检记录 create tianFW 2017/08/17
    ''' </summary>
    ''' <param name="para">containerid,workflowstepid,currentstatus</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetHistoryFinishCheckInfo(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' 获取成检继承信息 create tianFW 2018年1月11日
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetLastFinishCheckInheritInfo(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' 检验前的验证
    ''' add:Wangjh 20180524
    ''' </summary>
    ''' <param name="workReportID"></param>
    ''' <param name="type"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function ContainerCheckValidate(ByVal workReportID As String, ByVal type As Integer) As Boolean

    ''' <summary>
    ''' add:Wangjh 20181016 
    ''' 插入检验待处理批次工序
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function InsertContainerCheckSuspending(ByVal para As Dictionary(Of String, String)) As Boolean

    ''' <summary>
    ''' 更新检验待处理数据为无效
    ''' add:Wangjh 20181016
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateContainerCheckSuspending(ByVal containerID As String, ByVal stepID As String) As Boolean

    ''' <summary>
    ''' 查询是否有委托计量或返工返修 1：委托计量 2：返工返修 0:都没有
    ''' add:Wangjh 20181025
    ''' </summary>
    ''' <param name="dr"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function IshavingReworkORDelegate(ByVal dr As DataRow) As Integer

    ''' <summary>
    ''' 根据报废名获取报废信息
    ''' add:Wangjh 20181220
    ''' </summary>
    ''' <param name="name"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetLossReasonbyName(ByVal name As String) As DataTable

    ''' <summary>
    ''' yuxj20220923判断是否是施工单
    ''' </summary>
    ''' <param name="strCid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function boolIsSGD(ByVal strCid As String) As Boolean

#Region "Yuxj20200630 机加检验速度优化"
    '检验前检查
    Function ContainerCheckValidateList(ByVal workReportIDList As String, ByVal type As Integer) As DataTable
    '获取批次的所有工序检和首检检验的合格数
    Function GetAllAcceptQtyList(ByVal containerIDList As String) As DataTable
    Function FillContainerCheckInfo(ByVal entity As ContainerCheckInfoDTO) As Object()
    Function FillUpdateContainerCheckSuspending(ByVal containerID As String, ByVal stepID As String) As Object()
    Function FillUpdateContainerStepWorkReport(ByVal para As Dictionary(Of String, Object)) As Object()
#End Region

#Region "装试检验管理"
    ''' <summary>
    ''' 获取任务单/发动机号对应的报工但没有检验的所有批次
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    ''' 
    Function GetNotCheckContainer(ByVal para As Dictionary(Of String, String)) As uMESProcessResult

    ''' <summary>
    ''' 获取批次未报工ID
    ''' </summary>
    ''' <param name="cid"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetStepinfo(ByVal cid As String) As DataTable

    ''' <summary>
    ''' 获取故检工序列表
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetGJStepName(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    ''' 获取故检工步列表
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GeteGJStepInfoName(ByVal para As Dictionary(Of String, String)) As DataTable

    ''' <summary>
    '''  获取装配工艺的已派工但没有完工的工序工步 Add by Yuxj20180329
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetZSWorkFlowStepAndStepInfo(ByVal para As Dictionary(Of String, String)) As DataSet

    ''' <summary>
    ''' 验证装饰报工装配表是否已有备注note信息，如果有则返回该记录的唯一ID create by tianFW 2018年5月28日
    ''' </summary>
    ''' <param name="dto"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function VerifyZSWorkreportMaterialrRecordIsExistInfo(ByVal dto As ContainerStepWorkReportDTO, ByRef note As String) As String

    ''' <summary>
    ''' 更新装饰报工装配的备注信息 create  by tianFW 2018年5月28日 
    ''' </summary>
    ''' <param name="dto"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function UpdateZSWorkreportMaterialrRecordNote(ByVal dto As ContainerStepWorkReportDTO) As Boolean

    ''' <summary>
    ''' Add by Yuxj20180531 单独写故检查询的方法
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetGJCheckContainer(ByVal para As Dictionary(Of String, String)) As uMESProcessResult

    ''' <summary>
    ''' 获取装配工艺故检对应的工序工步 Add by Yuxj20180531
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetGJZSStepAndStepInfo(ByVal para As Dictionary(Of String, String)) As DataSet

    ''' <summary>
    ''' Yuxj20180601 装试单独使用，增加工步信息
    ''' </summary>
    ''' <param name="entity"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function AddZSContainerCheckInfo(ByVal entity As ContainerCheckInfoDTO) As Boolean

    ''' <summary>
    ''' 获取报工但没有检验的批次信息
    ''' </summary>
    ''' <param name="cidList"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetNoCheckStepByCid(ByVal cidList As String) As DataTable
#End Region

#Region "批量检验"
    ''' <summary>
    ''' 获取批量检验报工工序
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainerBatchCheckList(ByVal para As Dictionary(Of String, String)) As uMESProcessResult
    ''' <summary>
    ''' 批量保存检验记录
    ''' </summary>
    ''' <param name="checkList"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function SaveBatchCheckInfo(ByVal checkList As List(Of ContainerCheckInfoDTO), ByVal paras As List(Of Dictionary(Of String, Object))) As uMESProcessResult
#End Region

#Region "流水卡检验"
    ''' <summary>
    ''' 获取流水卡检验批次 add by zhangrj 2022-07-20
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetNewContainerCheckList(ByVal para As Dictionary(Of String, String)) As uMESProcessResult
    ''' <summary>
    ''' 获取批次的报工记录，且没有检验的
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetNewStepCheckByContainer(ByVal para As Dictionary(Of String, String)) As DataTable
#End Region

#Region "工步检验 add by zhangrj 2022-08-05"
    ''' <summary>
    ''' 获取待检验批次（工步） 
    ''' </summary>
    ''' <param name="QueryCondition"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainerStepInfoCheckData(ByVal QueryCondition As Dictionary(Of String, String)) As uMESProcessResult
    ''' <summary>
    ''' 获取待检验工步详细
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainerStepInfoCheckDetail(ByVal para As Dictionary(Of String, String)) As DataTable
    ''' <summary>
    ''' 获取工步报工详细
    ''' </summary>
    ''' <param name="reportIDs"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetStepInfoReportList(ByVal reportIDs As String) As DataTable
    ''' <summary>
    ''' 工步检验前检查
    ''' </summary>
    ''' <param name="workReportIDList"></param>
    ''' <param name="type"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function ContainerCheck2ValidateList(ByVal workReportIDList As String, ByVal type As Integer) As DataTable
    ''' <summary>
    ''' 保存工步检验信息
    ''' </summary>
    ''' <param name="checkList"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function SaveStepInfoCheckInfo(ByVal checkList As List(Of ContainerCheckInfoDTO), ByVal paras As List(Of Dictionary(Of String, Object))) As uMESProcessResult
    ''' <summary>
    ''' 获取批次的所有工序检和首检检验的合格数、报废数（工步）
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetAllAccepQtyListByStepInfo(ByVal containerIDList As String) As DataTable
    ''' <summary>
    ''' 获取工序下的所有工步的合格数
    ''' </summary>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetStepInfoAccepQty(ByVal para As DataRow) As DataTable
    ''' <summary>
    ''' 验证是否存在顺序号小的工步未检验完
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function IsExistNoCheckedPreStepInfo(ByVal para As DataRow) As Boolean
    ''' <summary>
    ''' 获取二检待检列表
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetContainerSecondCheckList(ByVal para As Dictionary(Of String, String)) As uMESProcessResult
    ''' <summary>
    ''' 获取可撤销的工步检验 add by zhangrj 2022-09-23
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetStepInfoDeletableCheckInfo(ByVal para As Dictionary(Of String, String)) As uMESProcessResult
    ''' <summary>
    ''' 保存工步检验撤销
    ''' </summary>
    ''' <param name="dtCheck"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function SaveStepInfoCheckCancel(ByVal dtCheck As DataTable) As uMESProcessResult
    ''' <summary>
    ''' 质量提起页面获取件号信息 add by zhangrj 2022-10-08
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetQualityCollectProductInfo(ByVal para As Dictionary(Of String, String)) As DataTable
    ''' <summary>
    ''' 保存质量提起 add by zhangrj 2022-10-09
    ''' </summary>
    ''' <param name="param"></param>
    ''' <param name="user"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function SaveQulityCollectData(ByVal param As DataRow, ByVal user As CurrentUserInfo) As uMESProcessResult
    ''' <summary>
    ''' 获取质量提起审核列表 add by zhangrj 2022-10-10
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetQualityCollectExamineData(ByVal para As Dictionary(Of String, String)) As DataTable
    ''' <summary>
    ''' 保存质量提起审核数据 add by zhangrj 2022-10-10
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function SaveQualityCollectExamineData(ByVal para As Dictionary(Of String, String)) As Boolean
    ''' <summary>
    ''' 获取批量检验工步数据
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetStepInfoBatchCheckList(ByVal para As Dictionary(Of String, String)) As uMESProcessResult
    ''' <summary>
    ''' 工步批量检验前验证 add by zhangrj 2022-10-14
    ''' </summary>
    ''' <param name="row"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function IsValidBatchStepInfoCheck(ByVal row As DataRow) As Boolean
#End Region
    ''' <summary>
    ''' 移动到下序，统一方法
    ''' add:Wangjh 20221029
    ''' </summary>
    ''' <param name="conPara"></param>
    ''' <param name="host"></param>
    ''' <param name="LastWipQty"></param>
    ''' <param name="levelAttributes"></param>
    ''' <param name="userInfo"></param>
    ''' <param name="strMsg"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function MoveNextStep(ByVal conPara As Dictionary(Of String, String), ByVal host As ServerHostInfo, ByVal LastWipQty As Integer, ByVal levelAttributes As DataTable, ByVal userInfo As CurrentUserInfo, ByRef strMsg As String) As Boolean


    ''' <summary>
    ''' 验证是否存在未录入实测值的检验 add by zhangrj 2023-04-20
    ''' </summary>
    ''' <param name="dt"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function IsInputCheckPointResult(ByVal dt As DataTable) As Boolean

    ''' <summary>
    ''' 工序检验确认前验证是否存在无效的报工 add by zhangrj 2023-04-20
    ''' </summary>
    ''' <param name="workReportIDList"></param>
    ''' <param name="type"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function IsVaildWorkReportForCheck(ByVal workReportIDList As String, ByVal type As Integer) As Boolean

    ''' <summary>
    ''' 工步检验确认前验证是否存在无效的报工 add by zhangrj 2023-04-20
    ''' </summary>
    ''' <param name="workReportIDList"></param>
    ''' <param name="type">0：多ID查询，1：单ID查询</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function IsVaildWorkReportForStepInfoCheck(ByVal workReportIDList As String, ByVal type As Integer) As Boolean
    ''' <summary>
    ''' 获取批量检验工步数据（热表）
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetRBStepInfoBatchCheckList(ByVal para As Dictionary(Of String, String)) As uMESProcessResult

    ''' <summary>
    ''' 获取工步待检验批次（热表）
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetRBContainerStepInfoCheckData(ByVal para As Dictionary(Of String, String)) As uMESProcessResult

    ''' <summary>
    ''' 获取待检验工步详细（热表）
    ''' </summary>
    ''' <param name="para"></param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function GetRBContainerStepInfoCheckDetail(ByVal para As Dictionary(Of String, String)) As DataTable

    Sub MainContainerAutoWork(ByVal conPara As Dictionary(Of String, String), ByVal userInfo As CurrentUserInfo, Optional ByVal isAheadFinish As Boolean = False)

    ''' <summary>
    ''' 验证特殊过程工序（检验时验证）add by zhangrj 20250331
    ''' </summary>
    ''' <param name="dtDatas">需要验证的数据源</param>
    ''' <param name="userInfo">操作人员</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function ValidSpecialCourseSpecReportByCheck(ByVal dtDatas As DataTable, ByVal userInfo As CurrentUserInfo) As SpecialReportValidDTO
    ''' <summary>
    ''' 验证三定卡片工序（验证主方法，入口）add by zhangrj 20251011
    ''' </summary>
    ''' <param name="dtDatas">需要验证的数据源</param>
    ''' <param name="userInfo">操作人员</param>
    ''' <returns></returns>
    ''' <remarks></remarks>
    Function ValidSpecThreeFixedCardByCheck(ByVal dtDatas As DataTable, ByVal userInfo As CurrentUserInfo) As Tuple(Of Boolean, String)
End Interface
